<?php
/* @var $this MessageController */
/* @var $model Message */

$this->breadcrumbs=array(
    'Users'=>array('user/index'),
    $this->userModel->user_name=>array('user/','profile'=>$this->userModel->user_name),
    'Compose',
);

$this->menu=array(
	array('label'=>Yii::t('message/views','Compose'), 'url'=>array('create')),
	array('label'=>Yii::t('message/views','Sent'), 'url'=>array('sent')),
	array('label'=>Yii::t('message/views','Inbox'), 'url'=>array('inbox')),
);
?>

<blockquote class="meta">

<h1><?php echo Yii::t('message/views','Contact To Administrator') ?></h1>

</blockquote>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'message-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note"><?php echo Yii::t('other/form', 'Fields with {alias} are required.', array('{alias}'=>'<span class="required">*</span>')) ?></p>

	<?php echo $form->errorSummary($model); ?>
    <input type="text" id="Message_receiver_id" style="display:none"></input>
    <div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'title'); ?>
    </div>
	<div class="row">
		<?php echo $form->labelEx($model,'content'); ?>
		<?php echo $form->textArea($model,'content',array('size'=>60,'maxlength'=>2000)); ?>
		<script type="text/javascript">
            var editor = new UE.ui.Editor({
                toolbars:[['undo','redo','RowSpacing','FontFamily','FontSize','insertimage', 'emotion', 'scrawl']]
            });
			editor.render("Message_content");
		</script>
		<?php echo $form->error($model,'content'); ?>
    </div>
	<?php /* The following code snippet is used to generate the verification code */ ?>
	<?php /* @author : nonglei */ ?>
	<?php /* @date : 23/04/2013 */ ?>
	<?php if(CCaptcha::checkRequirements()): ?>
	<div class="row">
		<?php echo $form->labelEx($model,'verifyCode'); ?>
		<div>
		<?php $this->widget('CCaptcha'); ?>
		<?php echo $form->textField($model,'verifyCode', array('size'=>10,'maxlength'=>80)); ?>
        </div>
		<?php echo $form->error($model,'verifyCode'); ?>
	</div>
		<?php echo CHtml::submitButton(Yii::t('message/views', 'Send'),array("id"=>"message-submit",'userName'=>$this->userModel->user_name)); ?>
	<?php endif; ?>

<?php $this->endWidget(); ?>

</div><!-- form -->
